#!/bin/bash

if [ "`tail $1 | grep finish`" = "" ]
then 
	echo $1 not finished
else
	echo $1 finished
	if [ -f "${1%\.*}-time.dat" ]
	then
		echo Output for $1 already exists. Conversion skipped.
	else
		echo Creating spectra...
		python3 hist.py --pattern ${1%\.*} $1
	fi
fi
